﻿// 登录游戏

using System.Collections;
using UnityEngine;
using UnityEngine.UI;
using System;
using System.Collections.Generic;
using MotionFramework.UIKit;


namespace DemoProject
{
    public partial class LogonForms : UIWindow
    {
        protected override void OnInit()
        {
            //定义本UI窗体的类型
            //base.CurrentUIType.UIWindow_Type = SysDefine.UIWindowType.Normal;
            base.CurrentUIType.UIWindow_ShowMode = UIWindowShowMode.Normal;
            
            //注册事件
            AddClickEventListener(m_Btn_LogonSysButton, LogonSysDeal);

        }//Awake_end

        #region  窗体生命周期
        protected override void OnEnter()
        {
            if (m_TextLogonSysText)
            {
                m_TextLogonSysText.text = ShowText("LogonSystem");
            }
            if (m_TextLogonText)
            {
                m_TextLogonText.text = ShowText("Logon");
            }
        }

        protected override void OnReEnter()
        {
            base.OnReEnter();
        }

        protected override void OnFreeze()
        {
            base.OnFreeze();
        }

        protected override void OnExit()
        {
            base.OnExit();
        } 
        #endregion

        //登陆游戏，后台处理
        private void LogonSysDeal()
        {
            //后台网络验证逻辑处理。
            //Todo......

            //验证成功后，转到下一个页面
            //ShowUIWindow(UIWindowID.SelectHeroForms.ToString());
            ShowUIWindow(SysConst.SelectHeroForms);
        }
    }//Class_end
}